/**
 * 请购申请清单详情js purchaseDetail.js
 * 版本号： v1.0.0
 */
$(function(){

    if(purchaseDetailList.length!=0){
        //初始化动态表格
        $("#activeTableForPurchaseDetail").dyActiveTable({
            idField: 'purdId',
            idFieldWidth: 60,
            optionButton:false,
            index:"序号",
            columns: [
                {field: 'materialName', title: '材料名称', width: 120, height: 30, type: 'text', option: 'required:true,validType:\'length[1,18]\', prompt:\'请输入材料名称\''},
                {field: 'brand', title: '材料品牌', width: 120, height: 30, type: 'text', option: 'validType:\'length[1,18]\', prompt:\'请输入品牌\'', class: 'easyui-textbox'},
                {field: 'standardType', title: '规格型号', width: 120, height: 30, type: 'text', option: 'required:true,validType:\'length[1,88]\', prompt:\'请输入规格型号\''},
                {field: 'technicalParameter', title: '技术参数', width: 120, height: 30, type: 'text', option: 'validType:\'length[1,88]\', prompt:\'请输入技术参数\'', class: 'easyui-textbox'},
                {field: 'meteringUnit', title: '计量单位', width: 120, height: 30, type: 'text', option: 'validType:\'length[1,18]\', prompt:\'请输入计量单位\''},
                {field: 'unitContractPrice', title: '合同单价(元)', width: 120, height: 30, type: 'text', isInput: false},
                {field: 'unitPrice', title: '采购单价(元)', width: 120, height: 30, type: 'text', option: 'required:true,validType:[\'floatOrInt\', \'length[1,18]\'], prompt:\'请输入采购单价\''},
                {field: 'purdNum', title: '请购数量', width: 120, height: 30, type: 'text', option: 'required:true,validType:[\'floatOrInt\', \'length[1,18]\'], prompt:\'请输入请购数量\''},
                {field: 'leftCount', title: '合同剩余量', width: 120, height: 30, type: 'text'},
                {field: 'reqRemark', title: '请购备注', width: 120, height: 30, type: 'text', option: 'validType:[\'length[1,188]\'], prompt:\'请输入请购备注\''},
                {field: 'purdTotalPrice', isInput: false, calculate: "multiply", calculateColumns: ['unitPrice','purdNum'], title: '合计金额(元)', width: 120, height: 30, type: 'text', class: ''}
            ]
        });

        //加载请购清单的数据
        var data = {
            dataList: purchaseDetailList,
            editable: false
        };

        $("#activeTableForPurchaseDetail").dyActiveTable("loadData", data);
    }
});